<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
<script src="http://apps.bdimg.com/libs/jquery/2.1.1/jquery.min.js"></script>
</head>
<body>
	<div>
		<form id="form1" action="login.json" method="post">
			地址<b style="color:red">*</b>：<input type="text" name=adsInfo id="adsInfo" value=""><span class="alt" style="display:none;color:red;"></span><br/>
			电话<b style="color:red">*</b>：<input type="text" name="adsPhone" id="adsPhone" value=""><br/>
			联系人<b style="color:red">*</b>：<input type="text" name="adsReve" id="adsReve" value=""><br/>
			<input type="button" id="sub" value="提交"><br/>
		</form>
	</div>
<script>
	$(function(){
		$('#sub').click(function(){
			if(undefined==$('#adsInfo').val()||''==$('#adsInfo').val()
					||undefined==$('#adsPhone').val()||''==$('#adsPhone').val()
					||undefined==$('#adsReve').val()||''==$('#adsReve').val())
			{
				return ;
			}
			$.ajax({
                type: "POST",
                url: "ads/add",
                data: $('#form1').serialize(),
                timeout: 1800000,  //30分钟的超时时间
                async: false,
                success: function(opResult){
                    if('0000'==opResult.respCode){
                        window.onlocation.href=opResult.obj;
                    } else {
                        alert(opResult.respMsg);
                    }
                },
                error:function () {
                	alert('操作失败');
                }
            });
		})
	})
</script>
</body>
</html>